﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using Zhao.Common.Helper;
using Zhao.Models.AppletDto;
using Zhao.Models.DTO;
using Zhao.Models.Entity;

namespace Zhao.IServer.Management_Arena
{
    /// <summary>
    /// 正式球馆表（已入驻商户）
    ///</summary>
    public interface IVenuesServer : IBaseService<Venues>
    {
        /// <summary>
        /// 获取球馆详细信息（分页）
        /// </summary>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">每页大小</param>
        /// <returns>球馆信息分页数据</returns>
        public Task<PageModel<VenueDto>> GetVenuesPage(Expression<Func<Venues, Area, Area, Area, bool>> expressionable, int pageIndex, int pageSize);

        /// <summary>
        /// 更新场馆银行卡信息(按需修改)
        /// </summary>
        /// <param name="venueId">场馆ID</param>
        /// <param name="dto">银行卡信息传输对象</param>
        /// <returns>操作结果</returns>
        public Task<ApiResult> UpdateVenueBankInfo(Guid venueId, BankInfoDto dto);

        /// <summary>
        /// 更新场馆的钱包密码
        /// </summary>
        /// <param name="venueId">场馆ID</param>
        /// <param name="pwd">新密码</param>
        /// <returns>操作结果</returns>
        public Task<ApiResult> UpdateWithdrawPassword(Guid venueId, string pwd);


        #region 小程序API
        /// <summary>
        /// 获取球馆详细信息
        /// </summary>
        /// <returns>球馆信息</returns>
        public Task<PageModel<VenueInfoDto>> GetVenueInfo(Expression<Func<Venues, bool>> expressionable, int pageIndex, int pageSize);

        /// <summary>
        /// 根据条件返回一个球馆详情信息
        /// </summary>
        /// <param name="expressionable"></param>
        /// <returns>球馆详情信息</returns>
        public Task<VenuesDetailsInfoDto> GetVenuesById(Expression<Func<Venues, Area, Area, Area, bool>> expressionable);
        
        /// <summary>
        /// 球馆账号开通与设置
        /// </summary>
        /// <param name="dto">球馆账号设置信息</param>
        /// <param name="applicationId">申请ID</param>
        /// <returns>操作结果</returns>
        public Task<ApiResult> SetupVenueAccountAsync(VenueAccountSetupDto dto, int applicationId);

        /// <summary>
        /// 获取用户关联的已通过申请记录
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns>申请记录列表</returns>
        public Task<List<VenueApplications>> GetUserApplications(int userId);
        #endregion
    }
}
